# Device-specific module
import os
import platform

NOKIA_TABLET = 'NOKIA_TABLET'
LINUX = 'LINUX'
WINDOWS = 'WINDOWS'
UMPC = 'UMPC'

devices = {
    'armv6l'    : NOKIA_TABLET,
    'i686'      : LINUX,
    'i386'      : LINUX,
    'x86_64'    : LINUX,
}

_current = None

def override(current):
    _current = current
    
def current():
    global _current
    if _current is None:
        if 'Windows' in platform.system():
            _current = WINDOWS
        else:
            a = os.popen("uname -m")
            line = a.read().strip()
            a.close()
            _current = devices[line]
    return _current
    


if __name__ == '__main__':
    device = current()
    print device
